---
--类名: TaskBattleTillOverEvent.lua
--创建日期: 2015-8-25
--创建人: 陈小虎
--功能描述: 任务战斗等待到结束事件
--修改内容:
--修改日期:   
--修改人:     
--修改备注: 
--

local Event = import(".Event")

local TaskBattleTillOverEvent = class("TaskBattleTillOverEvent",function()
    return Event.new()
end)

function TaskBattleTillOverEvent:ctor(params)
    self:setEventName(params.event)
    self.mNpcId = params.npcId
    -- self.mVideoFile = params.videoFile
    -- self.mFormationId = params.formationId
	local configDir = params.configDir
    self.mVideoFiles = {}--params.videoFiles--{file = "testVideo.data",formationId = 1,,jobId = 1}
    if params.videoFiles and type(params.videoFiles) == "table" then
    	for i,v in ipairs(params.videoFiles) do
    		local video = {}
    		video.file = v.file
			video.configDir = configDir
    		video.formationId = v.formationId
    		video.jobId = v.jobId
			video.uid = v.uid
    		table.insert(self.mVideoFiles,video)
    	end
    end
    self.mBattleDir = params.battleDir or "auto"
end

function TaskBattleTillOverEvent:getVideoFile(jobId)
	if self.mVideoFiles and type(self.mVideoFiles) == "table" then
    	for i,v in ipairs(self.mVideoFiles) do
    		local video = v
    		if video.jobId == jobId then
    			return video
    		end
    	end
    end
    return nil
end

return TaskBattleTillOverEvent